package com.codejiwei.core.sql

import org.apache.spark.sql.SparkSession

object Spark_SQL_JsonFile {
  def main(args: Array[String]): Unit = {
    val ss = SparkSession.builder().master("local[1]").appName("JsonFile").getOrCreate()
//    ss.read
//      .json("E:\\workspace\\spark-app-sdk\\spark-core\\src\\main\\resources\\user.json")
//      .show

    val df = ss.read.json("E:\\workspace\\spark-app-sdk\\spark-core\\src\\main\\resources\\user.json")
    df.createOrReplaceTempView("people")
    ss.sql("select * from people")
      .show


  }
}
